//
//  AVRequest.h
//  项目三
//
//  Created by rimi1 on 2016/12/7.
//  Copyright © 2016年 Wangxingqian. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UIResponder+CircleAnimation.h"

// Cloud用到的
typedef void(^QueryArr)(NSArray *objects, NSError *error);// 查询返回数组
typedef void(^AVSucceed)(BOOL succeed, NSError *error);// 保存是否成功
typedef void(^AVImage)(NSString *url, BOOL succeed, NSError *error);// 修改头像
typedef void(^AVFetch)(AVObject *object, NSError *error);

@interface AVRequest : NSObject

// 取出
+ (void)avFetchWithObj:(AVObject *)obj
                 fetch:(AVFetch)fetch;
// 保存
+ (void)avSaveWithObj:(AVObject *)obj
              succeed:(AVSucceed)succeed;
// 添加relation
+ (void)avSaveAllAddWithObj:(AVObject *)obj
                        key:(NSString *)key
                     objArr:(NSArray *)objArr
                   aSucceed:(AVSucceed)aSucceed;
// 删除relation
+ (void)avSaveAllRemoveWithObj:(AVObject *)obj
                           key:(NSString *)key
                        objArr:(NSArray *)objArr
                      rSucceed:(AVSucceed)rSucceed;
// 查询(1、查询类 2、查询key 3、查询的东西)，可以用来判断是否收藏，账号是否已经注册
+ (void)avQueryWithQuery:(AVQuery *)query
                queryArr:(QueryArr)queryArr;
// 上传图片
+ (void)avImageWithData:(NSData *)data
                succeed:(AVImage)succeed;
// 删除收藏
+ (void)avRemoveRelationWithObj:(AVObject *)obj key:(NSString *)key succeed:(AVSucceed)rSucceed;
// 添加收藏
+ (void)avAddRelationWithObj:(AVObject *)obj key:(NSString *)key succeed:(AVSucceed)aSucceed;

@end








